package com.hoopchina.util;

import java.io.File;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Environment;
import android.util.Log;

public class PathUtils {

	

//	BroadcastReceiver mExternalStorageReceiver;
//	boolean mExternalStorageAvailable = false;
//	boolean mExternalStorageWriteable = false;
//	static File mExternalStorageDirectory = null;
	
	public static File getExternalStorageDirectory() {
//		return mExternalStorageDirectory;
		return android.os.Environment.getExternalStorageDirectory();
	}
	
	public static String getExternalStoragePathString() {
		return android.os.Environment.getExternalStorageDirectory().toString();
	}
	

//	void updateExternalStorageState() {
//		String state = Environment.getExternalStorageState();
//		if (Environment.MEDIA_MOUNTED.equals(state)) {
//			mExternalStorageAvailable = mExternalStorageWriteable = true;
//			
//		} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
//			mExternalStorageAvailable = true;
//			mExternalStorageWriteable = false;
//		} else {
//			mExternalStorageAvailable = mExternalStorageWriteable = false;
//		}
//
//	}
//
//	void startWatchingExternalStorage(Context context) {
//		mExternalStorageReceiver = new BroadcastReceiver() {
//			@Override
//			public void onReceive(Context context, Intent intent) {
//				Log.i("test", "Storage: " + intent.getData());
//				updateExternalStorageState();
//			}
//		};
//		IntentFilter filter = new IntentFilter();
//		filter.addAction(Intent.ACTION_MEDIA_MOUNTED);
//		filter.addAction(Intent.ACTION_MEDIA_REMOVED);
//		context.registerReceiver(mExternalStorageReceiver, filter);
//		updateExternalStorageState();
//	}
//
//	void stopWatchingExternalStorage(Context context) {
//		context.unregisterReceiver(mExternalStorageReceiver);
//	}

}
